package com.vdm.service.impl;

import com.vdm.dao.PilotInfoMapper;
import com.vdm.model.PilotInfo;
import com.vdm.service.PilotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PilotServiceImpl implements PilotService {

    @Autowired
    PilotInfoMapper pilotInfoMapper;

    @Override
    public int updatePilotInfoStatus(List<Integer> ids, Integer type) {
        if (ids != null && ids.size() > 0) {
            return pilotInfoMapper.updatePilotInfoStatus(ids, type);
        } else {
            return 0;
        }
    }

    @Override
    public List<PilotInfo> pilotInfoList() {
        return pilotInfoMapper.pilotInfoInfoList();
    }

    @Override
    public int getPilotInfoCount() {
        return pilotInfoMapper.getPilotInfoCount();
    }

    @Override
    public int updateByPk(PilotInfo pilotInfo) {
        return pilotInfoMapper.updateByPrimaryKeySelective(pilotInfo);
    }

    @Override
    public int insertSelective(PilotInfo pilotInfo) {
        return pilotInfoMapper.insertSelective(pilotInfo);
    }

    @Override
    public List<PilotInfo> getAllPilotInfo() {
        return pilotInfoMapper.getAllPilotInfo();
    }
}
